<template>
  <div class="article-detail-page" v-if="article.id">
    <nav class="nav"> <span class="back" @click="$router.back()">&lt;</span> 面经详情</nav>
    <header class="header">
      <h1>{{article.stem}}</h1>
      <p>{{article.createdAt}} | {{article.views}} 浏览量 | {{article.likeCount}} 点赞数</p>
      <p><img :src="article.creatorAvatar" alt=""> <span>{{article.creatorName}}</span> </p>
    </header>
    <main class="body"> {{article.content}} </main>
  </div>
</template>
<script>
import axios from 'axios';
export default{
    name:'',
    data () {
        return {
          article:[]
        }
    },
    created () {
console.log(this.$route.params.id);
this.getarticle()
    },
    computed:{
    },
    methods:{
async getarticle(){
  const res = await axios(' https://mock.boxuegu.com/mock/3083/articles/'+this.$route.params.id)
  console.log(res.data.result,11111);
  this.article = res.data.result
}
    }
}
</script>
<style lang='less'  scoped>
    
</style>
